//
//  CheckInPicker.m
//  playSerengetiMobile1
//
//  Created by Lita Gratrix on 11/10/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "CheckInPickerView.h"

#define MAIN_FONT_SIZE 12
#define MIN_MAIN_FONT_SIZE 10
#define VIEW_WIDTH 150
#define VIEW_HEIGHT 45
#define INDENT 10
#define TOP_MARGIN 2

@implementation CheckInPickerView

@synthesize title;

const CGFloat kViewWidth = VIEW_WIDTH;
const CGFloat kViewHeight = VIEW_HEIGHT;

+ (CGFloat)viewWidth
{
    return kViewWidth;
}

+ (CGFloat)viewHeight 
{
    return kViewHeight;
}

- (id)initWithFrame:(CGRect)frame{
	NSLog(@"Entering checkInPickerView initWithFrame\n");
	// use predetermined frame size
	if (self = [super initWithFrame:CGRectMake(0.0, 0.0, kViewWidth, kViewHeight)])
	{
		self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
		self.backgroundColor = [UIColor clearColor];	// make the background transparent
	}
	return self;
}

- (void)drawRect:(CGRect)rect
{
	CGFloat yCoord = (self.bounds.size.height - MAIN_FONT_SIZE) / 2;
	CGRect titleRect = CGRectMake(INDENT, yCoord, (VIEW_WIDTH - INDENT), (VIEW_HEIGHT - TOP_MARGIN));
	[self.title drawInRect:titleRect
	 withFont:[UIFont systemFontOfSize:MAIN_FONT_SIZE]
	 lineBreakMode:UILineBreakModeWordWrap
	 alignment: UITextAlignmentLeft];
	 
}

// Enable accessibility for this view.
- (BOOL)isAccessibilityElement
{
	return YES;
}

// Return a string that describes this view.
- (NSString *)accessibilityLabel
{
	return self.title;
}

- (void)dealloc
{
	[title release];
	[super dealloc];
}

@end
